<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
	$(function() {
		$(".delete").click(function() {
			var str = new Array();
			$("input[name=select]:checked").each(function(index,domEle){
				var idd = $(domEle).parent().parent().find("input[type=hidden]").val();				
				str.push(idd);
		    }); 
		    if(str == null || str == ""){
		    	alert("请先选择要删除的图片");
		    	return;
		    }
		    $(".tip").fadeIn(500);
		    $(".sure").click(function(){
		    	str = str.join(","),
			    window.location.href="/htx-backer/deleteSlideshow?idd="+str+"&type=1";
			});
		});
		$("#selectAll").click(function() {
			if($("#selectAll").is(":checked")){
				$("input[name=select]").prop("checked","checked");
			}else{
				$("input[name=select]").attr("checked",false);
			}
		});
	});
</script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<script type="text/javascript">
$(function(){  
	$("div.holder").jPages({  
	  containerID : "item", 
	  first:"首页", 
	  previous : "上一页",  
	  next : "下一页",
	  last:"尾页",  
	  perPage : 10,  
	  //delay : 100,
	  //动画效果
	  //animation:"bounceInLeft"
	});  
 });  
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
 	 $(".tip").fadeIn(200);
  });
  
  $(".sure").click(function(){
 	 $(".tip").fadeOut(100);
  });

  $(".cancel").click(function(){
	  $(".tip").fadeOut(100);
  });
});
</script>
<style >
    input{
       border: solid 1px #d7a372;
    }
</style>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">广告管理</em></li>
			<li><ema href="javascript:void">发现轮播图</em></li>
		</ul>
	</div>
	<div class="rightinfo">
		<div >
			<table>
				<form action="<%=request.getContextPath()%>/selectSlideshowList" method="post" name="serch">
					<tr>
						<td class="zi"><span>添加时间：</span></td>
						<td><input type="date" name="startTime" />至<input type="date" name="endTime" /></td>
						<td><input type="hidden" name="type" value="1"/></td>
						<td class="zi" ><span >状态：</span></td>
						<td><select name="status">
								<option selected="selected" value="">请选择</option>
								<option value="启用">启用</option>
								<option value="禁用">禁用</option>
						</select></td>
						<td><input type="submit" value="查询" style="background-color: #dca571; padding: 7px; border-radius: 5%;margin-left:2px;height: 35px;" class="button" /></td>
					</tr>
				</form>
			</table>
		</div>
		
		<div class="tools">
			<ul class="toolbar">
				<li class="delete"><span><img src="<%=request.getContextPath()%>/images/t03.png" /></span>删除</li>
				<a href="<%=request.getContextPath()%>/ui/image/add_topic_image.jsp"><li><span><img src="<%=request.getContextPath()%>/images/t01.png" /></span>添加</li></a>
			</ul>
		</div>
		<table class="tablelist">
			<thead>
				<tr>
					<th><input type="checkbox" value="" id="selectAll" /></th>
					<th>标题</th>
					<th>图片</th>
					<th>链接</th>
					<th>添加时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody class="tb" id="item">
				<c:forEach items="${lists}" var="data">
					<tr>
						<td><input name="select" type="checkbox" value="" /></td>
						<input type="hidden" value="${data.id}"></input>
						<td>
							<c:if test="${data.position_id == 1}">轮播图一</c:if>
							<c:if test="${data.position_id == 2}">轮播图二</c:if>
							<c:if test="${data.position_id == 3}">轮播图三</c:if>
							<c:if test="${data.position_id == 4}">轮播图四</c:if>
							<c:if test="${data.position_id == 5}">轮播图五</c:if>
							<c:if test="${data.position_id == 6}">轮播图六</c:if>
							<c:if test="${data.position_id == 7}">轮播图七</c:if>
							<c:if test="${data.position_id == 8}">轮播图八</c:if>
						</td>
						<td><img src="${data.image_url}" height="60px" width="60px"/></td>
						<td>${data.image_link}</td>
						<td>${data.create_time}</td>
						<td>${data.is_ban}</td>
						<td><a href="/htx-backer/selectSlideshowList?type=1&id=${data.id}" style="cursor:pointer;color:blue;font-size:14px" class="tg">编辑</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div style="clear:both;"></div>
		<!-- 分页的页码 -->
		<div class="holder"></div>
		共${nums}条记录
		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认删除 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');

		  function update(a){
		     $(".tip").fadeIn(500);
		     $(".sure").click(function(){
		       var courseid = $(a).next().next().val() + "," + 1;
		       window.location.href="/by-backer/updateAuditStatu?courseid="+courseid;
		     });
		  }
	</script>
	
</body>
</html>
